package lacus.wd_cinema.repository;

import lacus.wd_cinema.entity.Ticket;
import lacus.wd_cinema.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * 与电影票相关的数据访问类
 * @author lacus
 * @version 0.6
 * @since 0.3
 */
@Repository
public interface TicketRepository extends JpaRepository<Ticket, String> {

    Page<Ticket> findByOwner(User owner, Pageable pageable);

    Page<Ticket> findByOwnerAndStatus(User owner, Ticket.Status status, Pageable pageable);
}
